home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / ROM_Kernel_Manuals / Hard_examples / lores_playfield.asm < prev    next >
Encoding:
Assembly Source File  |  1992-08-20  |  2.2 KB  |  55 lines

  1. ;
  2. ; lores_playfield.asm
  3. ;
  4. ; This example sets up a 320 x 200 playfield with one bitplane, which
  5. ; is located at $21000. Also, a Copper list is set up at $20000.
  6. ;
  7. ; This example relies on the include file hw_examples.i.
  8. ;
  9.         LEA     CUSTOM,a0               ; a0 points at custom chips
  10.         MOVE.W  #$1200,BPLCON0(a0)      ; One bitplane, enable composite color
  11.         MOVE.W  #0,BPLCON1(a0)          ; Set horizontal scroll value to 0
  12.         MOVE.W  #0,BPL1MOD(a0)          ; Set modulo to 0 for all odd bitplanes
  13.         MOVE.W  #$0038,DDFSTRT(a0)      ; Set data-fetch start to $38
  14.         MOVE.W  #$00D0,DDFSTOP(a0)      ; Set data-fetch stop to $D0
  15.         MOVE.W  #$2C81,DIWSTRT(a0)      ; Set DIWSTRT to $2C81
  16.         MOVE.W  #$F4C1,DIWSTOP(a0)      ; Set DIWSTOP to $F4C1
  17.         MOVE.W  #$0F00,COLOR00(a0)      ; Set background color to red
  18.         MOVE.W  #$0FF0,COLOR01(a0)      ; Set color register 1 to yellow
  19. ;
  20. ;  Fill bitplane with $FF00FF00 to produce stripes
  21. ;
  22.         MOVE.L  #$21000,a1      ; Point at beginning of bitplane
  23.         MOVE.L  #$FF00FF00,d0   ; We will write $FF00FF00 long words
  24.         MOVE.W  #2000,d1        ; 2000 long words = 8000 bytes
  25. ;
  26. LOOP:   MOVE.L  d0,(a1)+        ; Write a long word
  27.         DBRA    d1,LOOP         ; Decrement counter and loop until done...
  28. ;
  29. ;  Set up Copper list at $20000
  30. ;
  31.         MOVE.L  #$20000,a1      ; Point at Copper list destination
  32.         LEA     COPPERL(pc),a2  ; Point a2 at Copper list data
  33. CLOOP:  MOVE.L  (a2),(a1)+      ; Move a word
  34.         CMPI.L  #$FFFFFFFE,(a2)+        ; Check for last longword of Copper list
  35.         BNE     CLOOP           ; Loop until entire copper list is moved
  36. ;
  37. ;  Point Copper at Copper list
  38. ;
  39.         MOVE.L  #$20000,COP1LCH(a0)     ; Write to Copper location register
  40.         MOVE.W  COPJMP1(a0),d0  ; Force copper to $20000
  41. ;
  42. ;  Start DMA
  43. ;
  44.         MOVE.W  #(DMAF_SETCLR!DMAF_COPPER!DMAF_RASTER!DMAF_MASTER),DMACON(a0)
  45.                         ; Enable bitplane and Copper DMA
  46.         BRA     ....    ; Go do next task
  47. ;
  48. ;  This is the data for the Copper list.
  49. ;
  50. COPPERL:
  51.         DC.W    BPL1PTH,$0002   ; Move $0002 to address $0E0    (BPL1PTH)
  52.         DC.W    BPL1PTL,$1000   ; Move $1000 to address $0E2    (BPL1PTL)
  53.         DC.W    $FFFF,$FFFE     ; End of Copper list
  54. ;
  55.